package com.desksoft.ecommerce.vo.mall;

import java.text.ParseException;

import org.quartz.Scheduler;
import org.quartz.SchedulerException;
import org.springframework.scheduling.quartz.CronTriggerBean;

public class SchedulerService { 

	private Scheduler scheduler;

	public Scheduler getScheduler() {
		return scheduler;
	}

	public void setScheduler(Scheduler scheduler) {
		this.scheduler = scheduler;
	} 

	public void updateNotificationInterval(String time) throws ParseException, SchedulerException { 
	     CronTriggerBean trigger  =  (CronTriggerBean) scheduler.getTrigger("DiscussQuartzTrigger", Scheduler.DEFAULT_GROUP);
	     trigger.setCronExpression(time);
     	 scheduler.rescheduleJob("DiscussQuartzTrigger", Scheduler.DEFAULT_GROUP, trigger);

	
	} 
	} 

